package com.yanqu.road.entity.activity.cookboy.process2;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.yanqu.road.entity.DataObject;

import java.util.*;

//阶段1成品食材比赛
public class CookBoy2DishTable extends DataObject{

	private int activityId;

	private long userId;

	private int dishId;

	private int userDishId;

	private int no;//比赛场次

	private long serverId;

	private String joinerData;

	//userId
	private Map<Long, CookBoy2Joiner> cookBoy2JoinerMap;

	private long integral;

	private long openTime;

	private long overTime;

	public int getActivityId() {
		return activityId;
	}

	public void setActivityId(int activityId) {
		this.activityId = activityId;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public long getServerId() {
		return serverId;
	}

	public void setServerId(long serverId) {
		this.serverId = serverId;
	}

	public int getDishId() {
		return dishId;
	}

	public void setDishId(int dishId) {
		this.dishId = dishId;
	}

	public int getUserDishId() {
		return userDishId;
	}

	public void setUserDishId(int userDishId) {
		this.userDishId = userDishId;
	}

	public String getJoinerData() {
		return joinerData;
	}

	public void setJoinerData(String joinerData) {
		if(!joinerData.equals(this.joinerData)){
			this.joinerData = joinerData;
		}
	}

	public Map<Long, CookBoy2Joiner> getCookBoy2JoinerMap() {
		if(this.cookBoy2JoinerMap == null){
			this.cookBoy2JoinerMap = JSON.parseObject(joinerData, new TypeReference<Map<Long, CookBoy2Joiner>>() {});
		}
		return cookBoy2JoinerMap;
	}

	public void setCookBoy2JoinerMap(Map<Long, CookBoy2Joiner> cookBoy2JoinerMap) {
		this.cookBoy2JoinerMap = cookBoy2JoinerMap;
		setJoinerData(JSON.toJSONString(cookBoy2JoinerMap));
	}

	public long getIntegral() {
		return integral;
	}

	public void setIntegral(long integral) {
		if(integral != this.integral){
			this.integral = integral;
		}
	}

	public long getOpenTime() {
		return openTime;
	}

	public void setOpenTime(long openTime) {
		this.openTime = openTime;
	}

	public long getOverTime() {
		return overTime;
	}

	public void setOverTime(long overTime) {
		if(overTime != this.overTime){
			this.overTime = overTime;
		}
	}
}
